/*
day253
2020.5.7
*/
#include<deque>
#include<vector>
#include<cstdlib> 
using namespace std;

struct TreeNode {
    int val;
	TreeNode *left;
    TreeNode *right;
    TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};

class Solution {
public:
    vector<int> levelOrder(TreeNode* root) {
    	vector<int> res;
    	if(!root)
		{
			return res;
		 } 
    	
		deque<TreeNode *> que;
		que.push_back(root);
		
		while(!que.empty())
		{
			TreeNode *tem=que.front();
			que.pop_front();
			res.push_back(tem->val);
			
			if(tem->left)
			{
				que.push_back(tem->left);
			}
			
			if(tem->right)
			{
				que.push_back(tem->right);
			}
		}
		return res;
    }
};




int main()
{
	return 0;
 } 
